#include <iostream>
#include <unistd.h>
#include <thread>
using namespace std;

void *newthreadrun(void *arg)
{
    while (true)
    {
        cout << "I am new thread" << endl;
        sleep(1);
    }
}

int main()
{
    pthread_t ptd;
    pthread_create(&ptd, nullptr, newthreadrun, nullptr);
    while (true)
    {
        cout << "I am main thread" << endl;
        sleep(1);
    }
    return 0;
}